package org.onepiece.admin.common.config.xxljob;

import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * Created by IntelliJ IDEA.
 *
 * @author zhujianke@gaodun.com
 * @since 2022/9/3 13:06
 */

@Component
public class TestXxlJobHandler {

    @XxlJob("demoJobHandler")
    public void demoJobHandler() throws Exception {
//        XxlJobHelper.log("XXL-JOB, Hello World.");

        for (int i = 0; i < 5; i++) {
            System.out.println(i);
            TimeUnit.SECONDS.sleep(2);
        }
        // default success
    }
}
